package lib.wman.org.mvvm.databind;

import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import lib.wman.org.mvvm.presenter.ActivityPresenter;
import lib.wman.org.mvvm.view.IDelegate;

/**
 * 集成数据-视图绑定的Activity基类(Presenter层)
 *
 * @param <T> View层代理类
 * @param <D> DataBinding
 * @author kymjs (http://www.kymjs.com/) on 10/23/15.
 */
public abstract class DataBindActivity<T extends IDelegate, D extends ViewDataBinding> extends
        ActivityPresenter<T> {
    protected D binding;

    @Override
    protected D createBinding(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = super.createBinding(inflater, container, savedInstanceState);
        return binding;
    }
}
